<template>
    <div>
        <el-row :gutter="15">
			<el-form ref="elForm" :model="dataForm" :rules="rules" size="medium" label-width="160px" label-position="right" :disabled="setting.readonly">
				<el-col :span="12" v-if="JudgeShow('zyzmc')">
					<el-form-item label="作业证名称" prop="zyzmc" >
						<el-input v-model="dataForm.zyzmc"  :disabled ="JudgeWrite('zyzmc')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('zyzbh')">
					<el-form-item label="作业证编号" prop="zyzbh" >
						<el-input v-model="dataForm.zyzbh"  :disabled ="JudgeWrite('zyzbh')"  placeholder="系统自动生成" readonly >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sqdw')">
					<el-form-item label="申请单位" prop="sqdw" >
						<el-select v-model="dataForm.sqdw"  :disabled ="JudgeWrite('sqdw')"  placeholder="请选择" clearable :style='{"width":"100%"}' filterable >
							<el-option v-for="(item, index) in sqdwOptions" :key="index" :label="item.F_FullName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sqr')">
					<el-form-item label="申请人" prop="sqr" >
						<el-select v-model="dataForm.sqr"  :disabled ="JudgeWrite('sqr')"  placeholder="请选择" clearable :style='{"width":"100%"}' filterable >
							<el-option v-for="(item, index) in sqrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sqrq')">
					<el-form-item label="申请日期" prop="sqrq" >
						<el-date-picker v-model="dataForm.sqrq"  :disabled ="JudgeWrite('sqrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('dhzyjb')">
					<el-form-item label="动火作业级别" prop="dhzyjb" >
						<el-select v-model="dataForm.dhzyjb"  :disabled ="JudgeWrite('dhzyjb')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in dhzyjbOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('dhkssj')">
					<el-form-item label="动火开始时间" prop="dhkssj" >
						<el-date-picker v-model="dataForm.dhkssj"  :disabled ="JudgeWrite('dhkssj')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('dhjssj')">
					<el-form-item label="动火结束时间" prop="dhjssj" >
						<el-date-picker v-model="dataForm.dhjssj"  :disabled ="JudgeWrite('dhjssj')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('dhdd')">
					<el-form-item label="动火地点" prop="dhdd" >
						<el-input v-model="dataForm.dhdd"  :disabled ="JudgeWrite('dhdd')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('dhnr')">
					<el-form-item label="动火内容、方式" prop="dhnr" >
						<el-input v-model="dataForm.dhnr"  :disabled ="JudgeWrite('dhnr')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<!-- 动火信息数组 -->
				<el-col :span="24">
					<el-form-item
						v-for="(list, index) in dataList.dhxx"
						:key="index"
						label="动火人"
						prop="dhxx">
							<el-select v-model="list.dhr"  :disabled ="JudgeWrite('dhxx')"  placeholder="动火人" clearable style="width:210px" filterable >
								<el-option v-for="(item, index) in sgfzrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
							</el-select>
							<el-input :disabled ="JudgeWrite('dhxx')" style="width:210px" v-model="list.tsgzlb" placeholder="请输入特殊工种类别"></el-input>
							<el-input :disabled ="JudgeWrite('dhxx')" style="width:210px" v-model="list.tzgzzh" placeholder="请输入特殊工种证号"></el-input>
							<el-button :disabled="list.disabledAdd" @click="addDomain(list)" type="primary">新增</el-button>
							<el-button :disabled="list.disabled" @click.prevent="removeDomain(index)">删除</el-button>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sgdw')">
					<el-form-item label="施工单位" prop="sgdw" >
						<el-select v-model="dataForm.sgdw"  :disabled ="JudgeWrite('sgdw')"  placeholder="请选择" clearable :style='{"width":"100%"}' filterable >
							<el-option v-for="(item, index) in sgdwOptions" :key="index" :label="item.F_FullName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sgfzr')">
					<el-form-item label="施工负责人" prop="sgfzr" >
						<el-select v-model="dataForm.sgfzr"  :disabled ="JudgeWrite('sgfzr')"  placeholder="请选择" clearable :style='{"width":"100%"}' filterable >
							<el-option v-for="(item, index) in sgfzrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sjdqttszy')">
					<el-form-item label="涉及其他特殊作业" prop="sjdqttszy" >
						<el-input v-model="dataForm.sjdqttszy"  :disabled ="JudgeWrite('sjdqttszy')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('jhr')">
					<el-form-item label="监火人" prop="jhr" >
						<el-select v-model="dataForm.jhr"  :disabled ="JudgeWrite('jhr')"  placeholder="请选择" clearable :style='{"width":"100%"}' filterable >
							<el-option v-for="(item, index) in jhrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('hqdw')">
					<el-form-item label="会签单位" prop="hqdw" >
						<el-select v-model="dataForm.hqdw"  :disabled ="JudgeWrite('hqdw')"  placeholder="请选择" clearable :style='{"width":"100%"}' filterable >
							<el-option v-for="(item, index) in hqdwOptions" :key="index" :label="item.F_FullName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<!-- 采样分析和结果-开始 -->
				<el-col :span="24">
					<el-form-item  
					    v-for="(list, index) in dataCyList.cyfx"
						:key="index"
						label="采样分析和结果"
						prop="cyfx">
						<el-date-picker v-model="list.cyfxsj"  :disabled ="JudgeWrite('cyfx')"  placeholder="采样分析时间" clearable style="width:210px" type="date" format="yyyy-MM-dd" value-format="timestamp" >
						</el-date-picker>
						<el-input style="width:210px" v-model="list.cybw" :disabled ="JudgeWrite('cyfx')" placeholder="采样部位"></el-input>
						<el-input style="width:210px" v-model="list.zyhjdq" :disabled ="JudgeWrite('cyfx')" placeholder="作业环境大气"></el-input>
						<el-input style="width:210px" v-model="list.sbrqgxnb" :disabled ="JudgeWrite('cyfx')" placeholder="设备、容器、管线内部"></el-input>
						<el-input style="width:210px" v-model="list.ydqt" :disabled ="JudgeWrite('cyfx')" placeholder="有毒气体"></el-input>
						<el-select v-model="list.fxryqz" placeholder="分析人员签字" :disabled ="JudgeWrite('cyfx')" clearable style="width:210px" filterable >
							<el-option v-for="(item, index) in fxryqzOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
						<el-button  @click="addCy(list)" :disabled="list.disabledAdd" type="primary">新增</el-button>
						<el-button :disabled="list.disabled" @click.prevent="removeCy(index)">删除</el-button>
					</el-form-item>
				</el-col>	
				<!-- 采样分析和结果-结束 -->

				<el-col :span="24" v-if="JudgeShow('jhzgzh')">
					<el-form-item label="监火资格证号" prop="jhzgzh" >
						<el-input v-model="dataForm.jhzgzh"  :disabled ="JudgeWrite('jhzgzh')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('whbs')">
					<el-form-item label="危害辨识" prop="whbs" >
						<el-select v-model="whbs"  :disabled ="JudgeWrite('whbs')"  placeholder="请选择" clearable :style='{"width":"100%"}' multiple >
							<el-option v-for="(item, index) in whbsOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('aqcsqrr')">
					<el-form-item label="安全措施确认人" prop="aqcsqrr" >
						<el-select v-model="dataForm.aqcsqrr"  :disabled ="JudgeWrite('aqcsqrr')"  placeholder="请选择" clearable :style='{"width":"100%"}' filterable >
							<el-option v-for="(item, index) in aqcsqrrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('qtaqcs')">
					<el-form-item label="其他安全措施" prop="qtaqcs" >
						<el-input v-model="dataForm.qtaqcs"  :disabled ="JudgeWrite('qtaqcs')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":100}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('qrr')">
					<el-form-item label="其他安全措施确认人" prop="qrr" >
						<el-select v-model="dataForm.qrr"  :disabled ="JudgeWrite('qrr')"  placeholder="请选择" clearable :style='{"width":"100%"}' filterable >
							<el-option v-for="(item, index) in qrrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('aqjyr')">
					<el-form-item label="安全教育人" prop="aqjyr" >
						<el-select v-model="dataForm.aqjyr"  :disabled ="JudgeWrite('aqjyr')"  placeholder="请选择" clearable :style='{"width":"100%"}' filterable >
							<el-option v-for="(item, index) in aqjyrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('sdfzryj')">
					<el-form-item label="属地负责人意见" prop="sdfzryj" >
						<el-input v-model="dataForm.sdfzryj"  :disabled ="JudgeWrite('sdfzryj')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":100}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('fzrrq')">
					<el-form-item label="属地负责人意见日期" prop="fzrrq" >
						<el-date-picker v-model="dataForm.fzrrq"  :disabled ="JudgeWrite('fzrrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('aqglbmyj')">
					<el-form-item label="安全管理部门意见" prop="aqglbmyj" >
						<el-input v-model="dataForm.aqglbmyj"  :disabled ="JudgeWrite('aqglbmyj')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":100}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('aqglrq')">
					<el-form-item label="安全管理部门日期" prop="aqglrq" >
						<el-date-picker v-model="dataForm.aqglrq"  :disabled ="JudgeWrite('aqglrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('wgys')">
					<el-form-item label="完工验收" prop="wgys" >
						<el-input v-model="dataForm.wgys"  :disabled ="JudgeWrite('wgys')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":100}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('wgysrq')">
					<el-form-item label="完工验收日期" prop="wgysrq" >
						<el-date-picker v-model="dataForm.wgysrq"  :disabled ="JudgeWrite('wgysrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('dhspryj')">
					<el-form-item label="动火审批人意见" prop="dhspryj" >
						<el-input v-model="dataForm.dhspryj"  :disabled ="JudgeWrite('dhspryj')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":100}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('dhsprq')">
					<el-form-item label="动火审批日期" prop="dhsprq" >
						<el-date-picker v-model="dataForm.dhsprq"  :disabled ="JudgeWrite('dhsprq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
			</el-form>

        </el-row>
        <UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
    </div>
</template>
<script>
    import request from '@/utils/request'
    import { previewDataInterface } from '@/api/systemData/dataInterface'
    import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
    export default {
        components: {},
        props: [],
        data() {
            return {
                visible: false,
                setting: {},
                eventType: '',
                userBoxVisible: false,
								dataList:{
									dhxx:[{
										ydyhjz:undefined,
										dhr:undefined,
										tzgzzh:undefined,
										disabled:true,
									}],
								},
								dataCyList:{
									cyfx:[{
										cyfxsj:undefined,
										cybw:undefined,
										zyhjdq:undefined,
										sbrqgxnb:undefined,
										ydqt:undefined,
										fxryqz:undefined,
										disabled:true,
										disabledAdd:false,
									}],
								},
                dataForm: {
                    id:'',                    
					flowId: '',
					actionType:1,
					freeApproverUserId: '',
					zyzmc:undefined,
					zyzbh:undefined,
					sqdw:undefined,
					sqr:undefined,
					sqrq:undefined,
					dhzyjb:'特级',
					dhkssj:undefined,
					dhjssj:undefined,
					dhdd:undefined,
					dhnr:undefined,
					sgdw:undefined,
					sgfzr:undefined,
					sjdqttszy:undefined,
					jhr:undefined,
					jhzgzh:undefined,
					whbs:[],
					aqcsqrr:undefined,
					qtaqcs:undefined,
					qrr:undefined,
					aqjyr:undefined,
					sdfzryj:undefined,
					fzrrq:undefined,
					aqglbmyj:undefined,
					aqglrq:undefined,
					wgys:undefined,
					wgysrq:undefined,
					dhspryj:undefined,
					dhsprq:undefined,
          dhxx:undefined,
		  cyfx:undefined,
		  hqdw:undefined,
                },
                rules: {

                },
				sqdwOptions:[],
				sqrOptions:[],
				dhzyjbOptions:[{"fullName":"特级","id":"0"},{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"}],
				sgdwOptions:[],
				sgfzrOptions:[],
				jhrOptions:[],
				whbsOptions:[{"fullName":"火灾爆炸","id":"火灾爆炸"},{"fullName":"中毒和窒息","id":"中毒和窒息"},{"fullName":"触电","id":"触电"},{"fullName":"灼烫","id":"灼烫"},{"fullName":"机械伤害","id":"机械伤害"},{"fullName":"高处坠落","id":"高处坠落"},{"fullName":"物体打击","id":"物体打击"},{"fullName":"坍塌","id":"坍塌"},{"fullName":"其他","id":"其他"}],
				aqcsqrrOptions:[],
				qrrOptions:[],
				aqjyrOptions:[],

				hqdwOptions:[],
				fxryqzOptions:[],
				cyfxNum:1,
				whbs:[],


            }
        },
        computed: {},
        watch: {},
        created() {
		this.getsqdwOptions();
		this.getsqrOptions();
		this.getsgdwOptions();
		this.getsgfzrOptions();
		this.getjhrOptions();
		this.getaqcsqrrOptions();
		this.getqrrOptions();
		this.getaqjyrOptions();

		this.gethqdwOptions();
        this.getfxryqzOptions();
        },
        mounted() { },
        methods: {
					// 删除
					removeDomain(index) {
						this.dataList.dhxx.splice(index, 1)
					},
					// 新增
					addDomain() {
            this.dataList.dhxx.push({
							// dhxx:[{
						  		ydyhjz:undefined,
								dhr:undefined,
								tzgzzh:undefined,
								disabledAdd:false,
								disabled:false,
							// }],
						});
					},
					//采样分析结果新增
					addCy(){
						this.dataCyList.cyfx.push({
							cyfxsj:undefined,
							cybw:undefined,
							zyhjdq:undefined,
							sbrqgxnb:undefined,
							ydqt:undefined,
							fxryqz:undefined,
							disabled:false,
							disabledAdd:false,
						});
						this.cyfxNum++;
						if(this.cyfxNum == 3){
							for(let i in this.dataCyList.cyfx){
								this.dataCyList.cyfx[i].disabledAdd = true;
							}
						}
					},
					//采样分析结果删除
					removeCy(index){
						this.dataCyList.cyfx.splice(index, 1);
						this.cyfxNum--;
						for(let i in this.dataCyList.cyfx){
							this.dataCyList.cyfx[i].disabledAdd = false;
						}
					},
		getsqdwOptions()
		{
			previewDataInterface('772d2cbcadd24df79243e3d92ef5f690').then(res => {
				this.sqdwOptions = res.data
			})
		},
		getsqrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.sqrOptions = res.data
			})
		},
		getsgdwOptions()
		{
			previewDataInterface('772d2cbcadd24df79243e3d92ef5f690').then(res => {
				this.sgdwOptions = res.data
			})
		},
		gethqdwOptions(){
			previewDataInterface('772d2cbcadd24df79243e3d92ef5f690').then(res => {
				this.hqdwOptions = res.data
			})
		},
		getsgfzrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.sgfzrOptions = res.data
			})
		},
		getjhrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.jhrOptions = res.data
			})
		},
		getaqcsqrrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.aqcsqrrOptions = res.data
			})
		},
		getqrrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.qrrOptions = res.data
			})
		},
		getaqjyrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.aqjyrOptions = res.data
			})
		},

		getfxryqzOptions(){
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.fxryqzOptions = res.data
			})
		},

            goBack() {
                this.$emit('refresh')
            },
            init(data) {
                this.loading = true
                this.dataForm.id = data.id || ''
                this.setting = data
                this.visible = true;
                this.$nextTick(() => {
                    this.$refs['elForm'].resetFields();
                    if (this.dataForm.id) {
                        request({
                            url: '/api/WorkFlowForm/qyaqscDhzyxx/' + this.dataForm.id,
                            method: 'get'
                        }).then(res => {
                            this.dataForm = res.data
							this.whbs = this.dataForm.whbs ? this.dataForm.whbs.split(','):[];
                            this.dataList.dhxx = this.dataForm.dhxx ? JSON.parse(this.dataForm.dhxx) : [];
                            this.dataCyList.cyfx = this.dataForm.cyfx ? JSON.parse(this.dataForm.cyfx) : [];
							if(this.JudgeWrite('dhxx') == true){
								for(let i in this.dataCyList.cyfx){
									this.dataList.dhxx[i].disabledAdd = true;
								}
							}
							if(this.JudgeWrite('cyfx') == true){
								for(let i in this.dataCyList.cyfx){
									this.dataCyList.cyfx[i].disabledAdd = true;
								}
							}
                        })
                    } else {
                        this.dataForm.flowId = data.flowId
                    }
					
                    this.loading = false
                })
            },
            // 表单提交
            dataFormSubmit(eventType) {  
				this.dataForm.whbs = this.whbs.join(',');        	
                this.$refs['elForm'].validate((valid) => {
                    if (valid) {
                        if (eventType === 'audit' || eventType === 'reject') {
                            this.$emit('approval', this.dataForm, eventType)
                            return
                         }
                        this.dataForm.actionType = eventType === 'submit' ? 0 : 1
                        this.eventType = eventType
                        if (this.eventType === 'submit') {
                            if (this.setting.freeApprover == 0) {
                                this.$confirm('您确定要提交当前流程吗, 是否继续?', '提示', {
                                    type: 'warning'
                                }).then(() => {
                                    this.submit()
                                }).catch(() => { });
                            } else {
                                this.userBoxVisible = true
                                this.$nextTick(() => {
                                    this.$refs.userBox.init()
                                })
                            }
                        } else {
                            this.request()
                        }
                    }
                })
            },
            submit(freeApproverUserId) {
                if (freeApproverUserId) this.dataForm.freeApproverUserId = freeApproverUserId
                this.request()
            },
            request() {
                if (!this.dataForm.id) {
                    delete (this.dataForm.id)
						this.$set(this.dataForm, 'dhxx', JSON.stringify(this.dataList.dhxx));
						this.$set(this.dataForm, 'cyfx', JSON.stringify(this.dataCyList.cyfx));
						let quest = {...this.dataForm}
                    request({
                        url: '/api/WorkFlowForm/qyaqscDhzyxx',
                        method: 'post',
                        data: quest
                    }).then((res) => {
                        this.$message({
                            message: res.msg,
                            type: 'success',
                            duration: 1000,
                            onClose: () => {
                                this.visible = false
                                this.$emit('close', true)
                            }
                        })
                    })
                } else {
                    request({
                        url: '/api/WorkFlowForm/qyaqscDhzyxx/' + this.dataForm.id,
                        method: 'PUT',
                        data: this.dataForm
                    }).then((res) => {
                        this.$message({
                            message: res.msg,
                            type: 'success',
                            duration: 1000,
                            onClose: () => {
                                this.visible = false
                                this.$emit('close', true)
                            }
                        })
                    })
                }
            },
            JudgeShow(id) {
                if (!this.setting.formOperates || !this.setting.formOperates.length) return true
                let arr = this.setting.formOperates.filter(o => o.id === id) || []
                if (!arr.length) return true
                let item = arr[0]
                return item.read
            },
            JudgeWrite(id) {
                if (!this.setting.formOperates || !this.setting.formOperates.length) return false
                let arr = this.setting.formOperates.filter(o => o.id === id) || []
                if (!arr.length) return true
                let item = arr[0]
                return !item.write
            },

        },
    }

</script>
